package com.study.sbsummary.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

/**
 * DocContentVO 文章详情页返回结构体
 * http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=75278453
 */
@Data
@Accessors(chain = true)
public class DocContentVO {
	@JsonProperty("id")
	private Integer id;
	@JsonProperty("collection_id")
	private String collectionId;
	@JsonProperty("title")
	private String title;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JsonProperty("create_time")
	private LocalDateTime createTime;
	@JsonProperty("userid")
	private String userid;
	@JsonProperty("summary")
	private String summary;
	@JsonProperty("content")
	private String content;
	@JsonProperty("video_url")
	private String videoUrl;
	@JsonProperty("image_width")
	private Integer imageWidth;
	@JsonProperty("image_height")
	private Integer imageHeight;
	@JsonProperty("image_url")
	private String imageUrl;
	@JsonProperty("status")
	private Integer status;
	@JsonProperty("removed")
	private Integer removed;
	@JsonProperty("doc_type")
	private String docType;
	@JsonProperty("author_info")
	private UserInfoDTO authorInfo;
	@JsonProperty("docid")
	private String docid;
	@JsonProperty("is_like")
	private Boolean isLike;
	@JsonProperty("like_count")
	private Integer likeCount;
	@JsonProperty("comment_list")
	private List<Comment> commentList;
	@JsonProperty("comment_count")
	private Integer commentCount;
	@JsonProperty("action")
	private ActionDTO action;

	@Data
	public static class UserInfoDTO {
		@JsonProperty("userid")
		private String userid;
		@JsonProperty("nickname")
		private String nickname;
		@JsonProperty("profile")
		private String profile;
	}

	@Data
	public static class ActionDTO {
		@JsonProperty("path")
		private String path;
		@JsonProperty("action")
		private String action;
		@JsonProperty("parameters")
		private ParametersDTO parameters;
		@JsonProperty("options")
		private Boolean options;

		@Data
		public static class ParametersDTO {
			@JsonProperty("collection_id")
			private String collectionId;
			@JsonProperty("docid")
			private String docid;
		}
	}

	@Data
	public static class Comment {
		@JsonProperty("comment_id")
		@JSONField(name = "comment_id")
		String commentId;
		String comment;
		@JsonProperty("doc_auther")
		@JSONField(name = "doc_auther")
		String docAuther;
		@JsonProperty("create_time")
		@JSONField(name = "create_time")
		String createTime;
		@JsonProperty("comment_user_id")
		@JSONField(name = "comment_user_id")
		String commentUserId;
		@JsonProperty("comment_user_profile")
		@JSONField(name = "comment_user_profile")
		String commentUserProfile;
		@JsonProperty("comment_user_nickname")
		@JSONField(name = "comment_user_nickname")
		String commentUserNickname;
		@JsonProperty("top_comment_id")
		@JSONField(name = "top_comment_id")
		String topComment_id;
		@JsonProperty("reply_comment_id")
		@JSONField(name = "reply_comment_id")
		String replyCommentId;
		@JsonProperty("reply_user_id")
		@JSONField(name = "reply_user_id")
		String replyUserId;
		@JsonProperty("reply_user_nickname")
		@JSONField(name = "reply_user_nickname")
		String replyUserNickname;
	}

	public static final String ACTION_PATH =  "plog_detail_page";
	public static final String ACTION_PATH_IDEA_DETAIL =  "jelly_idea_page";//想法详情页
	public static final String ACTION_PATH_FEED_PAGE =  "friend_feed_page";//想法详情页
	public static final Boolean ACTION_MOVES_OPTION =  false;
	public static final String ACTION_MOVES_ACTION =  "push";
}
